package ds.factcom.domain.payment;

import java.util.Date;
import java.util.List;

import ds.factcom.domain.Domain;
import ds.factcom.domain.client.Client;
import ds.factcom.domain.invoice.Invoice;

public class Payment extends Domain {
	
	private static final long serialVersionUID = -7456793162912957509L;//esto solo para que el domain sea serializable.
	/**
	 * 
	 * @author Javier De Luca, Maximiliano Herrera, Matias Samblancat
	 * 
	 */
	
	public static Integer lastId = 0;
	
	private Client client;
	private Date date;
	private Float mount;
	private List<Invoice> invoices;
	
	public Payment(Client client, Float mount, List<Invoice> invoice){
		lastId = this.generateId();
		this.setId(lastId);
		this.client=client;
		this.date=new Date();
		this.mount=mount;
		this.invoices=invoice;
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Float getMount() {
		return mount;
	}

	public void setMount(Float mount) {
		this.mount = mount;
	}

	public List<Invoice> getInvoices() {
		return invoices;
	}

	public void setInvoices(List<Invoice> invoices) {
		this.invoices = invoices;
	}

	@Override
	protected Integer getLastId() {
		return lastId;
	}

	public boolean equals(Client client, List<Invoice> invoices) {
		return this.client.equals(client)&&
		this.invoices.equals(invoices);
	}

}
